<!--#include file="conn.asp"-->
<!--#include file="chkuser.asp"-->
<%
call adminRight(4)

ID=request("ID")
AllID=request("chk")

if request("action")="Del" then
	sql="Delete from job where ID="&ID
	conn.execute(sql)
	Go("Admin_Manpower.asp?showMsgStr=<br><b>招聘信息已删除成功！</b>|parent|3000|500||")
end if

if request("action")="delall" then
	If AllID="" Then Alert("没有选择数据"):GoBack():response.End()
	sql="delete from job where ID in("&AllID&")"
	conn.execute(sql)
	Go("Admin_Manpower.asp?showMsgStr=<br><b>招聘信息已批量删除成功！</b>|parent|3000|500||")
end if

if request("action")="editpx" then
	sql="update job set px="&request("px")&" where id="&request("EditID")
	conn.execute(sql)
	Go("Admin_Manpower.asp?curpage="&request("curpage")&"&showMsgStr=<br><b>招聘信息：排序修改成功！</b>|parent|3000|500||")
end if
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>招聘管理</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="popUpWin.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript" src="popupdiv.js"></script>

<script language="javascript" type="text/javascript">
function selcheck(id) {
   var e =document.getElementById(id);
   var objs = e.getElementsByTagName("input");
   if (e.checked){
      e.checked = false;
      for(var i=0; i<objs.length; i++) {
         if(objs[i].type.toLowerCase() == "checkbox" )
         objs[i].checked = false;
      }
   }   else   {
      e.checked = true;
      for(var i=0; i<objs.length; i++) {
         if(objs[i].type.toLowerCase() == "checkbox" )
         objs[i].checked = true;
      }
   }
}
</script>
</head>
<body>
<!--内容层--> 
<div id="ShopConfirmLayer" style="background-color:#FFFFFF;border:1px #cccccc solid;width:274px;" class="hidden"> 
	<div id="ShopConfirmTitle" style="padding: 12px 12px 12px 12px">
		<b>排序修改</b>
	</div>
	<div id="ShopConfirmContent" style="padding: 0px 12px 12px 12px">
		<form method="POST" id=formPX name="formPX" action="?action=editpx&curpage=<%=request("curpage")%>">
		<table cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td>
					编号：<input type="text" name="EditID"><br />
					排序：<input name="px" type="text" maxlength="100" value="0" onKeyPress="isnum()" />
					<input type=button value="上" onClick="javascript:this.form.px.value++;">
					<input type=button value="下" onClick="javascript:this.form.px.value--;">
				</td>
			</tr>
			<tr>
				<td height="12"></td>
			</tr>
	    <tr>
				<td align="right">
					<input name="btnSavePx" value="保存" type="submit" /> 
					<input name="btnExitPx" value="关闭" type="button" onClick="POPUP.cw('ShopConfirmLayer')"/> 
				</td>
			</tr>
		</table>
		</form>
	</div>
</div> 
<!--覆盖层--> 
<script type="text/javascript"> 
    function ShopConfirm(pxValue, classid)
		{ 
				document.formPX.px.value = pxValue;
				document.formPX.EditID.value = classid;
				POPUP.pw('ShopConfirmLayer');
    }
</script> 
    <div id="frame_Toolbar" class="toolbarBg"> 
		<a href="javascript:self.history.back();" class="icoBtn_ct"><span class="btnIco btnBack"></span>返回</a> 
		<a href="javascript:self.location.reload();" class="icoBtn_ct"><span class="btnIco btnReload"></span>刷新</a> 
		<span class="split ftSplit" ></span>
	    <div id="guide">点击<span class="light_orange"> 文章标题 </span>进行编辑</div>
		<%
			   Set rs = Server.CreateObject("ADODB.Recordset")
			   sql="select * from job order by px desc"
			   rs.open sql,conn,1,1
	    %>
	    <div class="pageInfo right light_gray">[当前共有<span id="Label_total_top" class="light_bOrange"><%=rs.recordcount%></span>条记录]</div>
    </div>
	<form method="POST" id=form2 name="form2" action="">
	<div id="MainContent">
     <table class="cTable table tCenter">
	    <tr class="cTitle toolbarBg">
		    <td width="7%"><span class="checkbox">
	      <input type="checkbox" name="chkall" onClick="selcheck('MainContent')" /></span></td>
		    <td width="10%"><span class="split ctSplit"></span>
	      <div>序号</div></td>
		    <td width="33%"><span class="split ctSplit"></span>
	      <div>职位名称</div></td>
		    <td width="16%"><span class="split ctSplit"></span>
	      <div>排序</div></td>
		    <td width="19%"><span class="split ctSplit"></span>
	      <div>发布时间</div></td>
		    <td width="15%"><span class="split ctSplit"></span>
	      <div>确认操作</div></td>
	    </tr>
	    <%
		   rs.pagesize=14
		   curpage=Request.QueryString("curpage")
		   if curpage="" then curpage=1
		   if not rs.eof then rs.absolutepage=curpage
		   for i=1 to rs.pagesize
		   if rs.eof then
		   exit for
		   end if
	    %>
		<tr class="trDataList" onMouseOver="this.className='trDataListHover'" onMouseOut="this.className='trDataList'">
		  <td><input type="checkbox" name="chk" value="<%=rs("ID")%>" id="<%=rs("ID")%>" /></td>
		  <td><%=rs("ID")%></td>
		  <td><a href="Admin_Manpower_Edit.asp?ID=<%=rs("ID")%>"><%=rs("Duix")%></a></td>
		  <td><%=rs("px")%>&nbsp;[<a href="#" onClick="ShopConfirm('<%=rs("px")%>', '<%=rs("ID")%>')">修改</a>]</td>
		  <td><%=rs("AddDate")%></td>
		  <td><a href="Admin_Manpower_Edit.asp?ID=<%=rs("ID")%>">编辑</a>/<a href="?ID=<%=rs("ID")%>&action=Del" onClick="return confirm('确定删除？')">删除</a></td>
		</tr>
		<%
			rs.movenext
			next
        %>	
	</table> 
    <div id="cEndToolbar" class="toolbarBg">
        <div class="pageList">
				<%
				set pageObj=new pager
				response.Write pageObj.link(rs.recordcount,rs.pagesize,curpage,"?curpage=",qryString)
				%>
		<%
			rs.close
			Set rs=nothing
		 %>
	    </div>
	    <div class="pageSelect"><span class="iptSl"><input type="checkbox" name="chkall" onClick="selcheck('MainContent')" /></span><a href="javascript:selcheck('MainContent');"><span class="btnTxt">选择</span></a></div>
	    <span class="split cpSplit" ></span>
	    <div class="pageBtnDo">
	        <div class="icoBtn_do"><input type="image" name="Delete_Button" id="Delete_Button" class="btnIco btnDel" src="images/Empty.gif" onClick="document.form2.action='?action=delall';return confirm('确定要删除吗?');" style="border-width:0px;" /></div>
	    </div>
	</div>	
    </div>
	</form>
</body>
</html>